#ifndef _THREADPOOL_
#define _THREADPOOL_

#include<my_header.h>
#include "Queue.h"
#include "tidarr.h"

typedef struct threadpool
{
    /* data */
    tidArr_t *tidArr;       //线程池
    Queue_t *taskArr;       //任务队列
    pthread_mutex_t mutex;  //工人线程执行的锁
    pthread_cond_t  cond;   //工人线程等待任务的队列
    int exitflag;         //退出标志
}threadpool_t;

int threadpoolInit(threadpool_t *threadpool,int workNum);

int makeworker(threadpool_t *threadpool);
int tcpinit(char *ip,char *port);
int epolladd(int epfd,int fd);
int epolldel(int epfd,int fd);
int transFile(int netfd);

#endif